﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Principal;

namespace PServiceBus.Core.Security {
    public class ESBPrincipal : IPrincipal {
        private ESBIdentity _identity = null;

        public ESBPrincipal(ESBIdentity identity) {
            _identity = identity;
        }

        #region IPrincipal Members

        public IIdentity Identity {
            get { return _identity; }
        }

        public ESBIdentity ESBIdentity { get { return _identity; } }

        public bool IsInRole(string role) {
            throw new NotImplementedException();
        }

        #endregion
        private static ESBPrincipal _current = null;
        public static ESBPrincipal Current {
            get { return _current ?? (_current = new ESBPrincipal(new ESBIdentity(null,null))); }
            set { _current = value; }
        }
    }
}
